package com.lh.project.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lh.project.model.entity.Food;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @Entity com.lh.project.model.entity.Food
*/
public interface FoodMapper extends BaseMapper<Food> {


    @Update("update food set sell_count = sell_count+${orderCount} where food_id = ${orderFoodId}")
    void addSellCount(Integer orderCount, Long orderFoodId);

    @Select("select count(*) from food where food_sort = ${id}")
    int getCountByFoodSortId(long id);
}
